package com.yicong.ants.view.component;

import android.view.LayoutInflater;
import android.view.View;

import androidx.appcompat.widget.AppCompatTextView;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.binioter.guideview.Component;
import com.yicong.ants.R;

/**
 * Description :
 *
 * @author ZhJiao
 * @date 2021/10/18
 */
public class SimpleComponent implements Component {
    AppCompatTextView textView;
    String content;
    @Override
    public View getView(LayoutInflater inflater) {
        ConstraintLayout constraintLayout =(ConstraintLayout)inflater.inflate(R.layout.item_indicator_layout,null);
        textView =  constraintLayout.findViewById(R.id.text);
        textView.setText(content);
        constraintLayout.setOnClickListener(v -> {

        });
        return constraintLayout;
    }

    public void setContent(String content){
        this.content = content;
    }

    @Override
    public int getAnchor() {
        return Component.ANCHOR_BOTTOM;
    }

    @Override
    public int getFitPosition() {
        return Component.FIT_END;
    }

    @Override
    public int getXOffset() {
        return 0;
    }

    @Override
    public int getYOffset() {
        return 10;
    }


}
